       
       
       <?php
        if(!empty($resList)){ ?>
                <section class="cat-widget wdg-cat-opposite clearfix">

                    <div class="widget-title">
                        <h3><a href="<?php echo base_url("restaurant/food");?>">Food</a></h3>
                        <span class="sub-title">แนะนำที่กินล่าสุด</span>
                        <div class="sep-widget"></div>
                    </div>

                    <div class="color-red widget-content clearfix">
                        <div>

                            <?php 
                            foreach ($resList as $key => $value) {
                                $key += 1;
                                if(($key % 2) == 0){
                                    $class_use = "even-item";
                                }else{
                                    $class_use = "odd-item";
                                }

                                ?>

                                <article class="<?php echo $class_use;?>" data-showonscroll="true" data-animation="fadeIn">
                                    <figure class="sec-image">

                                        <a class="post-thumbnail">
                                            <img src="<?php echo $imagepath;?>/upload/image_medium/<?php echo $value['img_medium'];?>" />
                                        </a>

                                        <div class="top-bar">
                                            <span class="likes"><a href="<?php echo base_url("restaurant/show_detail");?>"><i class="icon-heart"></i><?php echo Util::LikeCount($value["id"]); ?></a></span>

                                            <span class="comments"><i class="icon-bubble"></i>35</span>
                                            
                                            <span class="btn-srp "><a href="pg-category.html"><?php echo $value["tag_def"];?></a></span>
                                        </div>

                                        <div class="bottom-bar">
                                            <span class="btn-srp"><a href="<?php echo base_url("restaurant/show_detail/".$value["id"]);?>">เพิ่มเติม...</a></span>

                                             <div class="rating">
                                                <div class="stars retina x-2">
                                                    <div class="gray"><i></i><i></i><i></i><i></i><i></i></div>

                                                    <div class="fill" style="width: 80%">
                                                        <div class="light"><i></i><i></i><i></i><i></i><i></i></div>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>

                                    </figure>

                                    <div class="sec-desc">

                                        <header class="title">
                                            <h4 class="post-title"><a href="<?php echo base_url("restaurant/show_detail/".$value["id"]);?>"><?php echo $value["name"];?></a> | <?php echo $value["impression"];?></h4>
                                        </header>

                                        <div class="meta-info">
                                            <span class="author"><i class="icon-user3"></i><a href="#"><?php echo $value['user']['first_name'].$value['user']['last_name'];?></a></span>

                                            <span class="date-time"><i class="icon-alarm2"></i><?php echo Util::ezDate($value["cr_date"]);?></span>

                                        </div>


                                        <div class="post-desc">
                                            <p><?php echo Util::cutContent($value["content"]);?></p>
                                        </div>

                                    </div>
                                </article>

                                <?php
                                    if($key < count($resList)){
                                        ?>
                                        <div class="divider"></div>
                                        <?php
                                    }
                                ?>
                                
                                <?php
                            }
                            ?>

                            
<!--
                            <div class="divider"></div>

                            <article class="even-item" data-showonscroll="true" data-animation="fadeIn">
                                <figure class="sec-image">

                                    <a class="post-thumbnail">
                                        <img src="<?php echo $imagepath;?>/food/food3.jpg"/></a>

                                    <div class="top-bar">
                                        <span class="likes"><a href="#"><i class="icon-heart"></i>15</a></span>

                                        <span class="comments"><i class="icon-bubble"></i>35</span>

                                        <span class="views"><i class="icon-tv"></i>300</span>

                                        <span class="btn-srp"><a href="pg-category.html">อำเภอกะทู้</a></span>
                                    </div>

                                    <div class="bottom-bar">
                                        <span class="btn-srp"><a href="<?php echo base_url("restaurant/show_detail/".$resList["1"]["id"]);?>">เพิ่มเติม...</a></span>

                                        <div class="rating">
                                            <div class="stars retina x-2">
                                                <div class="gray"><i></i><i></i><i></i><i></i><i></i></div>

                                                <div class="fill" style="width: 80%">
                                                    <div class="light"><i></i><i></i><i></i><i></i><i></i></div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>

                                </figure>

                                <div class="sec-desc">

                                    <header class="title">
                                        <h4 class="post-title"><a href="<?php echo base_url("restaurant/show_detail/".$resList["1"]["id"]);?>"><?php echo $resList["1"]["title"];?></a></h4>
                                    </header>

                                    <div class="meta-info">
                                        <span class="author"><i class="icon-user3"></i><a href="#"><?php echo $resList["1"]["first_name"].$resList["1"]["last_name"];?></a></span>
                                        <span class="date-time"><i class="icon-alarm2"></i>26 Feb 2013, 05:15 AM</span>
                                    </div>


                                    <div class="post-desc">
                                        <p><?php echo $resList["1"]["content"];?></p>
                                    </div>

                                </div>
                            </article>

                            <div class="divider"></div>

                            <article class="odd-item" data-showonscroll="true" data-animation="fadeIn">
                                <figure class="sec-image">

                                    <a class="post-thumbnail">
                                        <img src="<?php echo $imagepath;?>/food/food5.jpg"/></a>

                                    <div class="top-bar">
                                        <span class="likes"><a href="#"><i class="icon-heart"></i>15</a></span>

                                        <span class="comments"><i class="icon-bubble"></i>35</span>

                                        <span class="views"><i class="icon-tv"></i>1555</span>

                                        <span class="btn-srp"><a href="pg-category.html">อำเภอถลาง</a></span>
                                    </div>

                                    <div class="bottom-bar">
                                        <span class="btn-srp"><a href="<?php echo base_url("restaurant/show_detail/".$resList["2"]["id"]);?>">เพิ่มเติม...</a></span>

                                        <div class="rating">
                                            <div class="stars retina x-2">
                                                <div class="gray"><i></i><i></i><i></i><i></i><i></i></div>

                                                <div class="fill" style="width: 80%">
                                                    <div class="light"><i></i><i></i><i></i><i></i><i></i></div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>

                                </figure>

                                <div class="sec-desc">

                                    <header class="title">
                                        <h4 class="post-title"><a href="<?php echo base_url("restaurant/show_detail/".$resList["2"]["id"]);?>"><?php echo $resList["2"]["title"];?></a></h4>
                                    </header>

                                    <div class="meta-info">
                                        <span class="author"><i class="icon-user3"></i><a href="#"><?php echo $resList["2"]["firstname"].$resList["2"]["lastname"];?></a></span>
                                        <span class="date-time"><i class="icon-alarm2"></i>26 Feb 2013, 05:15 AM</span>
                                    </div>


                                    <div class="post-desc">
                                        <p><?php echo $resList["2"]["title"];?></p>
                                    </div>

                                </div>
                            </article>
-->
                        </div>
                    </div>
                </section>
            <?php }
            else{ ?>
                <div class="error"><h4>ไม่มีข้อมูลร้าน</h4></div>
            <?php } ?>

            
                <div class="row wdg-cat-vert-container">
                   <?php if(!empty($traList)){ ?>
                    <section class="cat-widget wdg-cat-vert cat-vert-left clearfix col-md-6 col-sm-6 col-xs-12">

                        <div class="widget-title">
                            <h3><a href="<?php echo base_url("restaurant/travel");?>">Travel</a></h3>
                            <span class="sub-title">แนะนำที่เที่ยวล่าสุด</span>

                            <div class="sep-widget"></div>
                        </div>

                        <div class="widget-content color-theme clearfix">
                            <div>
                            <?php $key1="0"; ?>
                            <?php foreach ($traList as $key1 => $value1){
                                $key1 ++; 
                                
                                 if ($key1 == "1"){
                                ?>
                                <article class="first-post" data-showonscroll="true" data-animation="fadeIn">

                                    <a class="post-thumbnail">
                                        <img src="<?php echo $imagepath;?>/upload/image_medium/<?php echo $value1['img_medium'];?>"/></a>

                                    <div class="top-bar">
                                        <span class="likes"><a href="#"><i class="icon-heart"></i>15</a></span>
                                        <span class="comments"><i class="icon-bubble"></i>32</span>
                                        <span class="views"><i class="icon-tv"></i>15000</span>

                                        <span class="btn-srp"><a href="pg-category.html"><?php echo $value1['tag_def']; ?></a></span>
                                    </div>

                                    <header class="title-bar">
                                        <h4 class="post-title"><a href="<?php echo base_url("restaurant/show_detail");?>"><?php echo $value1['impression'];?></a></h4>

                                        <div class="meta-info">
                                            <span class="author"><i class="icon-user3"></i><a href="#"><?php echo $value1['user']['first_name'].$value1['user']['last_name'];?></a></span>
                                            <span class="date-time"><i class="icon-alarm2"></i><?php echo Util::ezDate($value1["cr_date"]);?></span>
                                        </div>

                                    </header>

                                    <div class="bottom-bar">
                                        <span class="btn-srp"><a href="<?php echo base_url("restaurant/show_detail");?>">เพิ่มเติม...</a></span>

                                        <div class="rating">
                                            <div class="stars retina x-2">
                                                <div class="gray"><i></i><i></i><i></i><i></i><i></i></div>

                                                <div class="fill" style="width: 50%">
                                                    <div class="light"><i></i><i></i><i></i><i></i><i></i></div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </article><?php  } if ($key1 > "1"){?>

                                <div class="related-posts">
                                    <div class="posts clearfix">

                                        <div class="post-item" data-showonscroll="true" data-animation="fadeIn">
                                            <article class="post-box clearfix">

                                                <figure class="wdg-col-4 sec-image">

                                                    <div class="mask-background white"></div>

                                                    <div class="post-thumbnail border-radius-2px">
                                                        <img class="border-radius-2px" src="<?php echo $imagepath;?>/upload/image_small/<?php echo $value1['img_small'];?>"/>
                                                    </div>

                                                    <a href="<?php echo base_url("restaurant/show_detail");?>" class="more"></a>
                                                </figure>

                                                <header class="wdg-col-8 sec-title">

                                                    <span class="btn-srp"><a href="pg-category.html"><?php echo $value1['tag_def']; ?></a></span>

                                                    <b><a href="<?php echo base_url("restaurant/show_detail");?>" title=""><?php echo $value1['name'];?> | <?php echo $value1['impression'];?></a></b>

                                                    <div class="meta-info">

                                                        <span class="author"><i class="icon-user3"></i><a href="#"><?php echo $value1['user']['first_name'].$value1['user']['last_name'];?></a></span>
                                                        <span class="date"><i class="icon-alarm2"></i><?php echo Util::ezDate($value1["cr_date"]);?></span>

                                                    </div>

                                                </header>
                                            </article>
                                        </div>
                                    </div>
                                </div>
                            <?php } 
                              } 
                            ?>
                               </div>
                            </div>
                </section>
                 <?php } ?>
                    <section class="cat-widget wdg-cat-vert cat-vert-right clearfix col-md-6 col-sm-6 col-xs-12">

                        <div class="widget-title">
                            <h3><a href="#">Article</a></h3>
                            <span class="sub-title">บทความล่าสุด</span>

                            <div class="sep-widget"></div>
                        </div>

                        <div class="widget-content color-theme clearfix">
                            <div>
                                <article class="first-post" data-showonscroll="true" data-animation="fadeIn">

                                    <a class="post-thumbnail">
                                        <img src="<?php echo $imagepath;?>/article/article4.jpg" /></a>

                                    <div class="top-bar">
                                        <span class="likes"><a href="#"><i class="icon-heart"></i>15</a></span>
                                        <span class="comments"><i class="icon-bubble"></i>1000</span>
                                        <span class="views"><i class="icon-tv"></i>30000</span>

                                        <span class="btn-srp"><a href="pg-category.html">ร้านอาหาร</a></span>
                                    </div>

                                    <header class="title-bar">
                                        <h4 class="post-title"><a href="#">ร้านน้องกาย</a></h4>

                                        <div class="meta-info">
                                            <span class="author"><i class="icon-user3"></i><a href="#">Serpentsoft</a></span>
                                            <span class="date-time"><i class="icon-alarm2"></i>26 Feb 2013, 05:15 AM</span>
                                        </div>

                                    </header>

                                    <div class="bottom-bar">
                                        <span class="btn-srp"><a href="#">เพิ่มเติม...</a></span>

                                        <div class="rating">
                                            <div class="stars retina x-2">
                                                <div class="gray"><i></i><i></i><i></i><i></i><i></i></div>

                                                <div class="fill" style="width: 40%">
                                                    <div class="light"><i></i><i></i><i></i><i></i><i></i></div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </article>

                                <div class="related-posts">
                                    <div class="posts clearfix">

                                        <div class="post-item" data-showonscroll="true" data-animation="fadeIn">
                                            <article class="post-box clearfix">

                                                <figure class="wdg-col-4 sec-image">

                                                    <div class="mask-background white"></div>

                                                    <div class="post-thumbnail border-radius-2px">
                                                        <img class="border-radius-2px" src="<?php echo $imagepath;?>/article/article5.jpg" />
                                                    </div>

                                                    <a href="#" class="more"></a>
                                                </figure>

                                                <header class="wdg-col-8 sec-title">

                                                    <span class="btn-srp"><a href="pg-category.html">ร้านอาหาร</a></span>

                                                    <b><a href="#" title="">ร้านกู้กู | ..........</a></b>

                                                    <div class="meta-info">

                                                        <span class="author"><i class="icon-user3"></i><a href="#">Serpentsoft</a></span>
                                                        <span class="date"><i class="icon-alarm2"></i>14 Aug 2013</span>

                                                    </div>

                                                </header>
                                            </article>
                                        </div>

                                        <div class="post-item" data-showonscroll="true" data-animation="fadeIn">
                                            <article class="post-box clearfix">

                                                <figure class="wdg-col-4 sec-image">

                                                    <div class="mask-background white"></div>

                                                    <div class="post-thumbnail border-radius-2px">
                                                        <img class="border-radius-2px" src="<?php echo $imagepath;?>/article/article6.png" />
                                                    </div>

                                                    <a href="#" class="more"></a>
                                                </figure>

                                                <header class="wdg-col-8 sec-title">

                                                    <span class="btn-srp"><a href="pg-category.html">แหล่งท่องเที่ยว</a></span>

                                                    <b><a href="#" title="">หาดกะรน | ..........</a></b>

                                                    <div class="meta-info">

                                                        <span class="author"><i class="icon-user3"></i><a href="#">Serpentsoft</a></span>
                                                        <span class="date"><i class="icon-alarm2"></i>14 Aug 2013</span>

                                                    </div>

                                                </header>
                                            </article>
                                        </div>

                                        <div class="post-item" data-showonscroll="true" data-animation="fadeIn">
                                            <article class="post-box clearfix">

                                                <figure class="wdg-col-4 sec-image">

                                                    <div class="mask-background white"></div>

                                                    <div class="post-thumbnail border-radius-2px">
                                                        <img class="border-radius-2px" src="<?php echo $imagepath;?>/article/article7.jpg"/>
                                                    </div>
 
                                                    <a href="#" class="more"></a>
                                                </figure>

                                                <header class="wdg-col-8 sec-title">

                                                    <span class="btn-srp"><a href="pg-category.html">ร้านอาหาร</a></span>

                                                    <b><a href="#" title="">ร้านน้องปุ้ย | ..........</a></b>

                                                    <div class="meta-info">

                                                        <span class="author"><i class="icon-user3"></i><a href="#">Serpentsoft</a></span>
                                                        <span class="date"><i class="icon-alarm2"></i>14 Aug 2013</span>

                                                    </div>

                                                </header>
                                            </article>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>

           